//
//  Home.swift
//  Slide_Menu_Animation
//
//  Created by qingzhou on 2021/5/12.
//

import SwiftUI

struct Home: View {
    @Binding var selectedTab: String
    init(selectedTab: Binding<String>) {
        self._selectedTab = selectedTab
        UITabBar.appearance().isHidden = true
    }
    var body: some View {
        TabView(selection: $selectedTab) {
            HomePage()
                .tag("主页")
            History()
                .tag("历史")
            Notifications()
                .tag("通知")
            Setting()
                .tag("设置")
            Help()
                .tag("帮助")
        }
    }
}

struct Home_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
struct HomePage: View {
    var body: some View {
        NavigationView{
            Text("主页")
                .font(.largeTitle)
                .fontWeight(.heavy)
                .foregroundColor(.primary)
                .navigationTitle("首页")
        }
    }
}
struct History: View {
    var body: some View {
        NavigationView{
            Text("历史")
                .font(.largeTitle)
                .fontWeight(.heavy)
                .foregroundColor(.primary)
                .navigationTitle("历史")
        }
    }
}
struct Notifications: View {
    var body: some View {
        NavigationView{
            Text("通知")
                .font(.largeTitle)
                .fontWeight(.heavy)
                .foregroundColor(.primary)
                .navigationTitle("通知")
        }
    }
}
struct Setting: View {
    var body: some View {
        NavigationView{
            Text("设置")
                .font(.largeTitle)
                .fontWeight(.heavy)
                .foregroundColor(.primary)
                .navigationTitle("设置")
        }
    }
}
struct Help: View {
    var body: some View {
        NavigationView{
            Text("帮助")
                .font(.largeTitle)
                .fontWeight(.heavy)
                .foregroundColor(.primary)
                .navigationTitle("帮助")
        }
    }
}
